﻿/**
 * ...
 * @author cc
 */
class cn.eminia.A2.utils.uConfig 
{
	
	public function uConfig() 
	{
		
	}
	
	public static function parseAsObject(str:String, obj:Object) {
		var obj = (obj == null || obj == undefined) ? {} : obj;
		var arr = str.split(",");
		for (var i:Number = 0; i<arr.length; i++) {
			var oo:String = arr[i];
			var ss = oo.split(":");
			obj[ss[0]] = toTypeFF(ss[1]);
		}
		return obj;
	}
	//------------------- beautiful line -----------------------
	// [use] 子功能 
	// [usage] _________
	// [level] private
	static function toTypeFF(a:String) {
		//1 判断是否数字
		//2 判断是否数组
		//3 否则是字符
		if (isNaN(a)) {
			//防御
			if (a.indexOf("[") != -1 && a.indexOf("[") == -1) {
				trace("ClueID = "+ __________ )	
				
			}
			if(a.indexOf("[")!=-1&&a.indexOf("[")!=-1){}
			return (a);
		} else {
			return Number(a);
		}
	}
	
	
}